<?php
/**
 * User: 昊天||597767865@qq.com
 * Date: 2019/9/3
 * Time: 15:37
 */
namespace backend\models;
use yii\db\ActiveRecord;

class Base extends ActiveRecord
{
    /**
     * 返回数组信息
     * @param $status
     * @param $msg
     * @return array
     */
    public function arrData($status, $msg)
    {
        return ['status' => $status, 'msg' => $msg];
    }

    public function json($status = '', $msg = '', $data = '')
    {
        $arr = ['status' => $status, 'msg' => $msg];
        if (!empty($data)) {
            $arr['data'] = $data;
        }
        exit(json_encode($arr, JSON_UNESCAPED_UNICODE));
    }
}
